home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
math
/
txtab605.zip
/
XWPTABLE.DOC
< prev
next >
Wrap
Text File
|
1996-03-24
|
4KB
|
90 lines
XWPTABLE.DOC
03/24/96
This is a fairly stupid program that tries to go through a WordPerfect file and
retrieve any table cells that it can find.
This program is totally worthless without the TXTABLE.EXE program (which should
have also been included in the ZIP with HTMSTRIP.EXE). It *may* be worthless
even without TXTABLE.EXE. :)
This is just a test program. I intend to use the code in another program (maybe
HTMSTRIP or TXTABLE) and just wanted to see what was possible. It's mainly here
so people can test it if they want and let me know if it works with different
versions of WordPerfect. (See my contact information at the end.)
I also have no idea what the actual format for a WordPerfect file is. I did
some guestimations to come up with this program. I have no idea, for example,
of how to tell how big the table actually is (how many rows or columns) although
I'm sure that information is in the table itself. The program also doesn't
really know when a new table starts so if you have more than one table in a
document, it will probably write everything out as one file.
If anyone knows detailed information about the WordPerfect file format, please
let me know. If you have similar information for other mainstream word
processing files, I'd also be interested. (Again, see contact information at
the end.)
I've tested this program with a grand total of three WordPerfect 5.1 for DOS
files and it seemed to pull off the cells okay but even then I notice that it
missed some of the cells. At least it won't screw up your files.
Well, after that tremendous build-up, how does the program work?
XWPTABLE.EXE goes through a WordPerfect input file, tries to pick out the cells,
and rewrites them in a text file (called, by default, infile.TST). This file
should be directly usable by the TXTABLE.EXE program.
Based on the number of cells found, the program tries to guess how many columns
it ran into. (Again, it doesn't really know.) The calculation for this is
fairly simple; it looks at the number of cells it found and figures there has to
be the same number in each row. It tries all cells per row combinations from 1
to 15 and reports on any where the number evenly goes into the total number of
cells. Unless you know the dimensions of the table better, you can try TXTABLE
using these column specs and the /DEBUG option to see if it got it correct.
One user, Charles Everitt, has reported that while XWPTABLE works, it's actually
easier to writet the WordPerfect file out to a text file using WordPerfect
itself (TextOut), and then take the resulting file (which will have
formfeeds--decimal 12's--between each cell) and feed that into TXTABLE directly.
(Converting the characters can be done with the freebie CHANGE or FIXTEXT
programs from Wayne Software. Check them out from the Web site
http://hjs.geol.uib.no/guthrie/
Syntax:
XWPTABLE infile [ outfile ] [ /EXT=.xxx ] [ /? ]
where:
"infile" is the name of WordPerfect 5.1 input file to process. It might work
with other versions of WordPerfect. I dunno!
"outfile" is the name of the TXTABLE input file to create. Is overwritten if it
exists already. If no output file name is provided, the routine will use the
infile and provide an extension of *.TST. (The default .TST extension can be
overridden using the /EXT=.xxx parameter.)
"/EXT=.xxx" allows you to specify a different default file extension for the
output file. This parameter only matters if you do not explicitly specify an
output file name. The default value is "/EXT=.TST".
"/?" or "/HELP" or "HELP" shows you the syntax for the command.
Author:
This program was written by Bruce Guthrie. This is a test program only. I
wouldn't recommend distributing it since it won't be around for long. But I
would love to know any and all of the following:
(a) Did it work for you?
(b) Did you try it with something other than WordPerfect 5.1 tables?
(c) Do you have any information about the formats for these files?
Please e-mail comments to me at bguthrie@nmaa.org.
Thanks!